package nftrainer.helper;


public class Parser {
	
	public NFMap parse(String toParse) {
		NFMap map = new NFMap();
		String[] result = toParse.split(":");
		if (result != null) {
			if (result.length > 0) {
				for (String s : result[0].split(",")) {
					map.addToKeys(s);
					map.addToAll(s);
				}
			}
			if (result.length > 1) {
				for (String s : result[1].split(",")) {
					map.addToValues(s);
					map.addToAll(s);
				}
			}
		}
		return map;
	}

}
